Tenofas' modular FLUX Workflow v.4.3

5.0

7 reviews
99
37.9K
12.5K
43
Description

UPDATE - Dec. 14, 2024: Version 4.3 Guide is out: added a chapter for FLUX tools (Redux, Inpaint/Outpaint, Depth and Canny). Link: https://civitai.com/articles/6848/

Uploaded a new file for the workflow ( ModularWFv4.3fix2.json ) to fix a new bug in the Redux module. Please download the fixed version.

Please, before downloading and using the new workflow, update ComfyUI and all your Custom Nodes.


This is a modular and easy to use ComfyUI workflow for FLUX (by Black Forest Labs. Inc.). It is still a "work in progress" as FLUX is a new model and new tools for FLUX are coming day after day.

I created this workflow mostly for "realistic portrait photo" images, but it can be used for any kind of image you want to create thanks to its modularity.

Before using the workflow, please ensure you updated ComfyUI and all the Custom Nodes used in the workflow. This will avoid many possible errors.

The workflow is divided into several nodes' groups (modules) each with a specific color. You can find a detailed guide here: https://civitai.com/articles/6848 (Now updated to v.4.2)
I will try to keep the guide updated as much as possible, but if you need a better description or explanation of its modules just let me know.

The workflow lets you use the following modules:

1) Core FLUX module: just a plain and simple FLUX image generator with multiple LoRA's.  You can use the original FLUX models or the GGUF models.  

2) Many different Prompt methods (txt2img, img2img, LLM prompt generator...)

3) Latent Noise Injection

4) Face Expression Module

5) ADetailer (face, eyes and hands)

6) Inpaint

7) Faceswap

8) Ultimate SD Upscaler

9) Post Processing module (with LUT, grain and vignette).

10) Shakker-Labs Controlnet UnionPro

11) FLUX Tools: Redux, Inpaint/Outpaint, Depth and Canny.

Node Diagram
Discussion
J
John Reijmer7 months ago

Any chance of getting some sort of faceswap node going? Mostly interested in either use the first output to generate multiple other outputs as the same character. I keep trying to find a way to incorperate it after flux generation, but you're updating your workflows so fast I can't keep up. Might as well ask/suggest as an idea.


But this workflow, mate, is really something. It works exactly how I want it with minimal effort and it just keeps getting better and better. Love it!

❤️1

The first IPadapter for FLUX came out yesterday, and it's still in beta... not working very well yet.  Same thing for other Controlnet modules, they are not giving consistent results, some could also cause errors or other problems to the workflow.  But as soon as there will be a working IPadapter for faceswap I will absolutely add it to the workflow, I promise.  So.... just stay tuned!

👍3
❤️1
K
KurtC PhotoEd5 months ago

It would be awesome to get a Flux Pulid workflow built in - I have one here somewhere you can use if you want…

T
Tenofas5 months ago

I am working on the new version and was planning to check Pulid and see if it can be integrated in the workflow...

❤️1
K
KurtC PhotoEd5 months ago

Awesome! I’ve built a fully runnable Image shared in the Discord for  https://mimicpc.com/?fpr=adam47 and I’ll keep it updated as you change things - Can I ask with the Inpainting - which prompt area is it supposed to listen to when you mask the image?

T
Tenofas5 months ago

In Inpaint Module, only the masked area is generated, and the workflow will try to adapt to the rest of the image you loaded, a new generated image.  This new generated image comes from any kind of prompt you decide to use.  I usually work with the Input 1 (txt2img) prompt if I want to use Inpaint, but also the other prompt input should work fine.

❤️1
K
KurtC PhotoEd5 months ago

Thanks - yes input 1 works - everyone is asking for a video tutorial of all the features - I said i would ask you lol…. 😎😂

T
Tenofas5 months ago

Yes, I am thinking about it.  I guess I will do a few video about the general workflow and every single module in detail.  The only thing holding me back is that my spoken english is terrible... 😔

🤔1
K
KurtC PhotoEd5 months ago

I would use a simple text to speech for the narration - there are plenty of free open source ones now. If you need any help let me know - you can give me text files and I can make the audio - and you can chop it up to fit the video…


T
Tenofas5 months ago

Thanks for the idea... if I need help I will contact you for sure.  

Anyway, new version 4.2 is coming out next friday.  I did not have time to test Pulid, but I plan to test it for next big release (v.5).  I am also writing an article that explain how the workflow works, like a guide to the workflow.  After v.4.2 is published I will start to work on the video tutorials.

❤️1
K
KurtC PhotoEd5 months ago

Nice - out of interest - one issue I had was when using img2img with Florence - being able to change Florence output to add trigger word for character or whatever. So I added  https://github.com/chrisgoringe/cg-text-editing  after Florence to pause and allow edit of text… really helps


T
Tenofas5 months ago

interesting, thanks!

y
yy7 months ago

how do i upload my own lora into the workflow?

You save the Lora's in the Lora folder:  ComfyUI/models/loras/

Refresh ComfyUI page, and you should be able to use your lora.

x
xiaoxian14806 months ago

服务器不够的小伙伴可以直接用悦灵犀app

B
Brain wu6 months ago
# ComfyUI Error Report
## Error Details
- **Node Type:** TaraAdvancedComposition
- **Exception Type:** openai.APIConnectionError
- **Exception Message:** Connection error.
## Stack Trace

What is the solution to this problem?

You have to save the Groq's API key with a different node.  "Tara Save Api" node that you must add manually in the workflow, save the API key and then you can delete that node.  Let me know if you have trouble saving it.

G
Gaurav Misra6 months ago

It's all red, maybe because of ComfyUI's new 0.22 update?

I use a lot of custom nodes, the big red ones are "Image compare" and "Image Save w/metadata" for example.  No idea why the are red on the node diagram preview...

(Edited)
smarthies6 months ago

Thanks for this amazing Workflow. I'm using normal prompt with latent noise injection, adetailer and ultimate sd upscaler After some finetuning while using loras it produces great images!

I have one problem: The first facedetailer works well. The mask covers the face. If I understand correctly, the second facedetailer should then improve the eyes, but despite the correct bbox model, it does not recognize the eyes, i.e. no mask of the eyes is recognizable. Therefore, it does not process this region.

What could be the reason for this? Everything is set to standard and these are simple images of people and portaits.

Workflow Ver. 4.

T
Tenofas6 months ago

Yes, sometimes the eyes for some reason are not correctly recognized... I am working on it for the next version that should be out hopefully next weekend.

smarthies6 months ago

When using some loras (flux_realism, boreal, ...) I get moire patterns with Latent Noice Injection, but only in conjunction with Latent Upscaling. How can I avoid that?

T
Tenofas6 months ago

Unfortunately LoRA's can be a problem if you use Latent injection... Maybe a solution could be: don't upscale in Latent Noise Injection but use the Ultimate SD Upscaler.

J
John Reijmer5 months ago

So far this workflow is amazing. Just a question, is it all layered in the sense that when u enable faceswapper, will it take on that result of that picture and work on that? Or do you need change it to img2img and load that image?

T
Tenofas5 months ago

Unfortunately the quality of faceswap with ReActor is not high, so if you use that module the workflow stops there.  I am waiting for a good IPAdapter model to replace the module and integrate it in the workflow.  But for the moment Controlnet and Ipadapter for FLUX are not good enough.

❤️1
J
John Reijmer5 months ago

Yeah, I've been mixing abit on that front, trying out upscaling by reducing the quality slightly first and then upscaling it with flux controlnet again. But it's it's not that good. We'll have to wait. But the current state of your workflow works great! My hats off for you, sir!

❤️1
J
JustaName5 months ago

I'm having problems installing the following:

  • ReActorFaceSwap
  • ReActorFaceBoost

ComfyUI manager doesn't seem to support them. Any fix please? I tired manual install it didn't work.

T
Tenofas5 months ago

Did you try to update COmfy and all the custom nodes?

D
Derek J5 months ago

Would love if you add another option for true img2img in addition to the florence img2prompt2img. Unless I'm missing something and it's somewhere in the WF?


(Edited)
T
Tenofas5 months ago

The img2img module is a true img2img, the Florence2 nodes are now just an help for prompting if you want to modify something in the image.  But the text prompt in the module has very little effect on the image, it depends on the denoise values.

S
Sergio Valsecchi5 months ago

I believe some update has "broken" the denoise function.

  • Exception Message: BasicScheduler.get_sigmas() missing 1 required positional argument: 'denoise'
T
Tenofas5 months ago

A couple of nodes in the Latent Noise Injection Module, for some weird reason, were disconected:

1) "Latent Upscale (range: 1.0-2.0)" this one needs to be conected to "Upscaled values", at letter "c".

2) "Denoise (default 0.55)" this one needs to be conected to 2 other different nodes: "Denoise" at letter "a", and "BasicScheduler" (below "Upscale Latent" and above "RandomNoise" nodes) at "denoise" (of course).

This is the only thing that was wrong after updating everything. Let me know if this will fix your workflow.

🔥1
T
Tenofas5 months ago

Also... Same problem in the img2img module.  The node "img2img Denoise (range: 0.30-0.90)" has to be connected to a node in the red module "Workflow Control Center". The node is the "Denoise switch" one, and it should be connected to "any_01".

P
Pheonis5 months ago

Getting this error in the sampler 1 node in the latent injection group,
Here img2img and latent injection are enabled.

"RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, 3, 24, -1] because the unspecified dimension size -1 can be any value and is ambiguous"

👍2
S
Shelby Kunz5 months ago

Same issue here.

T
Tenofas5 months ago

A couple of nodes in the Latent Noise Injection Module, for some weird reason, were disconected:

1) "Latent Upscale (range: 1.0-2.0)" this one needs to be conected to "Upscaled values", at letter "c".

2) "Denoise (default 0.55)" this one needs to be conected to 2 other different nodes: "Denoise" at letter "a", and "BasicScheduler" (below "Upscale Latent" and above "RandomNoise" nodes) at "denoise" (of course).

This is the only thing that was wrong after updating everything. Let me know if this will fix your workflow.

T
Tenofas5 months ago

A couple of nodes in the Latent Noise Injection Module, for some weird reason, were disconected:

1) "Latent Upscale (range: 1.0-2.0)" this one needs to be conected to "Upscaled values", at letter "c".

2) "Denoise (default 0.55)" this one needs to be conected to 2 other different nodes: "Denoise" at letter "a", and "BasicScheduler" (below "Upscale Latent" and above "RandomNoise" nodes) at "denoise" (of course).

This is the only thing that was wrong after updating everything. Let me know if this will fix your workflow.

T
Tenofas(OP)5 months ago

I just came back from a 1-week vacation, and I see many messages about this error in my workflow.  

I guess there has been an update (in the nodes or in ComfyUI) that broke the workflow.

I will do a nice backup first of all my ComfyUI folder without the updates, then I will update everything and start to check the errors and try to fix them... Stay tune and sorry for the inconveniece.

H
Hidalgo Serra4 months ago

Gorgeous  workflow, i have only a question, how can i set the ending group the number 8 to use all previous one and keep the replaced face? because if i active all groups, at the end i have the one that comes from group 7 not even 10, thank you

(Edited)
H
Hidalgo Serra2 months ago

i am confused, if i activate the face swap nodes then the detailer is still working with the non swapped face, how i can have the face swap to work at the end so that the detailer consider the swapped face and not a random one?

And how you are supposed to make the changes with the inpaint, in none of the nodes there is a prompt for it

(Edited)
J
JediMa2 months ago

I m starting from zero , so I'm missing quite a few nodes, how can I install them? the civitai link is not working anymore

Reviews

O

Oguzhan Dolman

2 months ago

Everything's included! You can start from scratch, to create your own lora database, or what u want!

v

voxefx

2 months ago

Brilliant.

B

Bdaboss Bdaboss

2 months ago

S

Sergio Valsecchi

5 months ago

Great workflow!

m

matthew chin

7 months ago

Stefano, ComfyUI workflow v3 tried, great and useful. May I ask if there is a non flux version which allow the 4 text modes input ?

E

ED 3D

7 months ago

Amazing workflow, thanks again, friend!

J

John Reijmer

7 months ago

By far my most used ready-out-of-the-box workflow. Love it!

Versions (14)

  • - latest (3 months ago)

  • - v20241213-151821

  • - v20241207-140119

  • - v20241026-144401

  • - v20241025-065020

  • - v20240927-170157

  • - v20240908-163657

  • - v20240830-191311

  • - v20240823-150622

  • - v20240821-125900

  • - v20240820-132442

  • - v20240818-153353

  • - v20240818-084738

  • - v20240815-152522

Primitive Nodes (118)

Any Switch (rgthree) (14)

Anything Everywhere (1)

Anything Everywhere3 (1)

CreateExtraMetaData (1)

DetailDaemonSamplerNode (1)

DownloadAndLoadFlorence2Model (1)

ExpressionEditor (1)

Fast Bypasser (rgthree) (5)

Fast Groups Bypasser (rgthree) (1)

Fast Muter (rgthree) (1)

Florence2Run (1)

FluxGuidance (2)

GetNode (18)

Image Comparer (rgthree) (9)

ImageSmartSharpen+ (2)

InjectLatentNoise+ (1)

Label (rgthree) (7)

ModelSamplingFlux (2)

Note Plus (mtb) (11)

PortraitMasterBaseCharacter (1)

PortraitMasterMakeup (1)

PortraitMasterSkinDetails (1)

PortraitMasterStylePose (1)

Power Lora Loader (rgthree) (1)

ReActorFaceBoost (1)

SetNode (9)

SetShakkerLabsUnionControlNetType (1)

SimpleMathDual+ (2)

StyleModelApplyAdvanced (2)

Switch any [Crystools] (3)

Switch image [Crystools] (1)

Switch mask [Crystools] (1)

UnetLoaderGGUF (1)

mxSlider (12)

Custom Nodes (97)

  • - CR Overlay Text (2)

  • - CR Prompt Text (2)

ComfyUI

  • - VAEDecode (2)

  • - VAELoader (1)

  • - DualCLIPLoader (1)

  • - BasicGuider (2)

  • - RandomNoise (2)

  • - UpscaleModelLoader (1)

  • - CLIPTextEncode (3)

  • - LoadImage (7)

  • - SamplerCustomAdvanced (3)

  • - DisableNoise (1)

  • - BasicScheduler (2)

  • - LatentUpscale (1)

  • - VAEEncode (1)

  • - LatentUpscaleBy (1)

  • - DifferentialDiffusion (1)

  • - InpaintModelConditioning (2)

  • - PreviewImage (4)

  • - CLIPVisionLoader (2)

  • - CLIPVisionEncode (2)

  • - StyleModelLoader (2)

  • - SplitSigmasDenoise (1)

  • - LatentCrop (1)

  • - ImagePadForOutpaint (1)

  • - ConditioningZeroOut (1)

  • - ControlNetLoader (1)

  • - KSamplerSelect (1)

  • - InstructPixToPixConditioning (1)

  • - ControlNetApplyAdvanced (1)

  • - UNETLoader (1)

  • - easy float (1)

  • - easy boolean (2)

  • - MaskPreview+ (1)

  • - SimpleMath+ (1)

  • - SDXLEmptyLatentSizePicker+ (1)

  • - FaceDetailer (3)

  • - SAMLoader (1)

  • - UltralyticsDetectorProvider (3)

  • - ImpactGaussianBlurMask (1)

  • - UnzipPrompt //Inspire (1)

  • - LoadPromptsFromFile //Inspire (1)

  • - AIO_Preprocessor (1)

  • - DepthAnythingPreprocessor (1)

  • - CannyEdgePreprocessor (1)

  • - ProPostApplyLUT (1)

  • - ProPostFilmGrain (1)

  • - ProPostVignette (1)

  • - SaveImageWithMetaData (7)

  • - TaraPresetLLMConfig (1)

  • - TaraAdvancedComposition (1)

  • - Image Brightness Adjustment [Dream] (1)

  • - LoadAndResizeImage (1)

  • - ReActorFaceSwap (1)

  • - UltimateSDUpscale (1)

  • - Seed Everywhere (1)

  • - Image Size to Number (2)

  • - Conditioning Input Switch (1)

Checkpoints (0)

LoRAs (0)